package com.entmanage.common.exception.user;

import com.entmanage.common.exception.base.BaseException;

/**
 * 用户信息异常类
 * 
 * @author ruoyi
 */
public class UserException extends BaseException
{
    private static final long serialVersionUID = 1L;

    // 新增常用异常代码常量
    public static final String EMPLOYEE_NOT_FOUND = "employee.not_found";
    public static final String EMPLOYEE_ALREADY_REGISTERED = "employee.already_registered";

    public UserException(String code, Object[] args)
    {
        super("user", code, args, null);
    }

    /**
     * 新增：快速创建员工相关异常
     */
    public static UserException employeeNotFound() {
        return new UserException(EMPLOYEE_NOT_FOUND, null);
    }

    public static UserException employeeAlreadyRegistered() {
        return new UserException(EMPLOYEE_ALREADY_REGISTERED, null);
    }
    /**
     * 新增：支持直接传入错误消息（不通过code转换）
     */
    public UserException(String message) {
        super(message);
    }

}
